#ifndef PUBLICTOOL_H
#define PUBLICTOOL_H

#include <QPixmap>
#include <QByteArray>
#include <QDataStream>
#include <QFile>
#include <QBuffer>
#include <QImage>
#include <QTableWidget>

class DB_View_StudentInfo;

class PublicTool
{
public:
    PublicTool();

    static QByteArray QPixmapToQByteArray(const QPixmap &pixmap);

    static QPixmap QByteArrayToQPixmap(const QByteArray &imageData);

    static void setTableHead(QTableWidget* wgt, QStringList head);

    static void setTableInit(QTableWidget* wgt);

    static QString openCSVSaveDialog(QString name = "");

    static QString openCSVOpenDialog();

    static void showErr(const QString& err);

    static void showEarlyWarning(QString str);

    static void showEarlyWarning(QList<DB_View_StudentInfo> stus,QString app);
};

#endif // PUBLICTOOL_H
